# 数据读取及基本处理
import pandas as pd
import numpy as np

# plotting
import seaborn as sn
import matplotlib.pyplot as plt
#matplotlib inline
import datetime
# setting params


params = {'legend.fontsize': 'x-large',
          'figure.figsize': (30, 10),
          'axes.labelsize': 'x-large',
          'axes.titlesize':'x-large',
          'xtick.labelsize':'x-large',
          'ytick.labelsize':'x-large'}

sn.set_style('whitegrid')
sn.set_context('talk')

plt.rcParams.update(params)
pd.options.display.max_colwidth = 600

# pandas display data frames as tables
from IPython.display import display, HTML


# 读入数据
train = pd.read_csv("day.csv")
#print("train : " + str(train.shape))
##print(train.head()) #查看前5行数据
##print(train.info()) #查看数据的总体信息
##
##print(train.describe())#对数据值型特征，用常用统计量观察其分布
##
###对类别型特征，观察其取值范围及直方图
##categorical_features = ['season','mnth','weathersit','weekday']
##for col in categorical_features:
##    print('\n%s属性的不同取值和出现的次数'%col)
##    print(train[col].value_counts())
##    train[col] = train[col].astype('object')

#一年中每天的骑车量
###对数值型特征，直方图
##numerical_features = ['temp','atemp','hum','windspeed']
##train[numerical_features].hist()
###每年骑行量的分布
##sn.violinplot(data=train[['yr',
##                        'cnt']],
##              x="yr",y="cnt")




corrMatt = train[["temp","atemp",
                  "hum","windspeed",
                  "casual","registered",
                  "cnt"]].corr()

mask = np.array(corrMatt)

mask[np.tril_indices_from(mask)] = False

sn.heatmap(corrMatt, mask=mask,
           vmax=.8, square=True,annot=True)











